package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javabean.Sticker;

public class Insertsti extends Insert{
	public void insertDB(Sticker sti) {
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
        	conn = getConnection();

            pstmt = conn.prepareStatement("insert into STICKER values (?,?,?,?,?,?,?,?,?,?,?)");
            pstmt.setString(1, null);
            pstmt.setString(2, sti.getStiNAME());
            pstmt.setString(3, sti.getStiTEXT());
            pstmt.setString(4, sti.getStiDATE());
            pstmt.setString(5, sti.getStiSTATE());
            pstmt.setString(6, sti.getStiTYPE());
            pstmt.setString(7, sti.getStiSTATUS());
            pstmt.setString(8, sti.getEmpTO());
            pstmt.setString(9, sti.getEmpFROM());
            pstmt.setInt(10, sti.getProNO());
            pstmt.setInt(11, sti.getStiCOUNT());
                        
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}